<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>

<script>
    //number类型变量
    var test=1;
    var test1=1.5;
    alert(typeof test)
    alert(typeof test1)
    //字符类型变量
    var test='a';
    var test1='abc'
    var test2="asdasd"
    alert(typeof test)
    alert(typeof test1)
    alert(typeof test2)

    //null类型变量
    var test=null;
    alert(typeof test)//会提示Object类型，但是其实还是null类型变量


    //布尔类型变量
    var test =true;
    var test1=false
    alert(typeof test)
    alert(typeof test1)


    //undefined变量类型(变量没赋初值就会提示undefined)
    var test
    alert(typeof test)
</script>
</body>
</html>